package frans

/*type Responder interface {
	RespondTo() gin.HandlerFunc
}

type StringResponder func(ctx *gin.Context) string

func (this *StringResponder) RespondTo() gin.HandlerFunc {
	return nil
}

type ModelResponder func(ctx *gin.Context) Model

func (this *ModelResponder) RespondTo() gin.HandlerFunc {
	return nil
}

type MapResponder func(ctx *gin.Context) gin.H

func (this *MapResponder) RespondTo() gin.HandlerFunc {
	return nil
}

type View string
type ViewResponder func(ctx *gin.Context) View

func (this *ViewResponder) RespondTo() gin.HandlerFunc {
	return nil
}

var ResponderList []Responder

func init() {
	ResponderList = []Responder{
		new(StringResponder),
		new(ModelResponder),
		new(ViewResponder),
	}
}

func Covert(handler interface{}) gin.HandlerFunc {

	h_ref := reflect.ValueOf(handler)

	for _, r := range ResponderList {
		r_ref := reflect.ValueOf(r).Elem()
		if h_ref.Type().ConvertibleTo(r_ref.Type()) {
			r_ref.Set(h_ref)
			return r_ref.Interface().(Responder).RespondTo()
		}
	}

	return nil
}*/
